/**
 * Created by jimshi0912 on 15/11/2.
 */
(function () {
    angular.module('my-tabs.directives')
        .directive('dialogItem', dialogItem);

    function dialogItem() {
        return {
            restrict: 'C',
            templateUrl: 'views/friend/dialog-item.html',
            controller: ['$scope', '$state', 'sessionService', function ($scope, $state, session) {
                if($scope.conv.owner.id ===
                    session.getSignInUser().id){
                    $scope.isMe = true;
                }
                if($scope.conv.word.indexOf('[转账]') == 0){
                    $scope.zz = true;
                }
                $scope.delete = function () {

                };
            }],
            link: function (scope, element, attrs, controller) {
                if(scope.isMe){
                    element.addClass('me')
                }else{
                    element.removeClass('me')
                }
            }
        }
    }
})();
